/* 任务管理页面 - Bootstrap风格样式 */

/* 自定义变量 */
:root {
    --bs-primary-rgb: 13, 110, 253;
    --task-indent: 1.5rem;
    --task-level-1-indent: 0;
    --task-level-2-indent: 2rem;
    --task-level-3-indent: 3.5rem;
}

/* 页面布局 */
.main-content {
    padding: 1rem;
}

/* 页面头部 */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--bs-dark);
}

.page-header .breadcrumb {
    margin-bottom: 0;
}

/* 筛选面板 */
.filter-panel .card-header {
    background-color: var(--bs-light);
    border-bottom: 1px solid var(--bs-border-color);
}

/* 筛选面板折叠按钮样式 */
.filter-panel .card-header .btn-link {
    color: var(--bs-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left !important;
    justify-content: flex-start;
    display: flex;
    align-items: center;
    transition: color 0.15s ease-in-out;
}

.filter-panel .card-header .btn-link:hover {
    color: var(--bs-primary);
}

.filter-panel .card-header .btn-link:focus {
    box-shadow: none;
    outline: none;
}

.filter-panel .card-header .btn-link i.bi-chevron-down {
    transition: transform 0.15s ease-in-out;
    font-size: 0.875rem;
    color: var(--bs-secondary);
}

.filter-panel .card-header .btn-link[aria-expanded="true"] i.bi-chevron-down {
    transform: rotate(180deg);
}

.filter-panel .form-label {
    font-weight: 500;
    color: var(--bs-secondary);
    margin-bottom: 0.25rem;
}

/* 筛选面板表单控件对齐 */
.filter-panel .row {
    align-items: end;
}

/* 统一表单控件高度 */
.filter-panel .form-control,
.filter-panel .form-select {
    height: 38px;
    min-height: 38px;
}

.filter-panel .input-group {
    height: 38px;
}

.filter-panel .input-group .form-control {
    height: 100%;
}

/* 统一按钮高度和样式 */
.filter-panel .btn {
    height: 38px;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.filter-panel .btn-group {
    height: 38px;
}

.filter-panel .btn-group .btn {
    height: 100%;
}

/* 确保所有列的底部对齐 */
.filter-panel .col-md-2,
.filter-panel .col-md-4 {
    display: flex;
    flex-direction: column;
}

.filter-panel .col-md-2 .form-label,
.filter-panel .col-md-4 .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

/* 操作按钮列特殊处理 */
.filter-panel .d-flex.align-items-end {
    min-height: 38px;
    padding-top: 1.5rem; /* 为label预留空间 */
}

/* 任务表格 */
.task-table {
    font-size: 0.875rem;
}

.task-table th {
    background-color: var(--bs-light);
    font-weight: 600;
    color: var(--bs-dark);
    border-bottom: 2px solid var(--bs-border-color);
    padding: 0.75rem 0.5rem;
}

.task-table td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

/* 子任务缩进 */
.task-table .ms-3 {
    margin-left: var(--task-indent) !important;
}

/* 状态和优先级徽章 */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* 进度条 */
.progress {
    background-color: var(--bs-gray-200);
}

.progress-bar {
    transition: width 0.3s ease;
}

/* 操作按钮 */
.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* 空状态 */
.text-center.py-5 i {
    opacity: 0.5;
}

/* 分页 */
.pagination .page-link {
    color: var(--bs-primary);
    border-color: var(--bs-border-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.pagination .page-item.disabled .page-link {
    color: var(--bs-secondary);
    background-color: var(--bs-light);
    border-color: var(--bs-border-color);
}

/* 模态框 */
.modal-header {
    border-bottom: 1px solid var(--bs-border-color);
}

.modal-footer {
    border-top: 1px solid var(--bs-border-color);
}

/* Offcanvas */
.offcanvas {
    width: 650px !important;
}

.offcanvas-header {
    border-bottom: 1px solid var(--bs-border-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .task-table {
        font-size: 0.8rem;
    }
    
    .task-table th,
    .task-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .offcanvas {
        width: 100% !important;
    }
    
    .btn-group-sm > .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .page-header .d-flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-panel .row {
        margin: 0;
    }
    
    .filter-panel .col-md-3,
    .filter-panel .col-md-4,
    .filter-panel .col-md-6 {
        padding: 0.25rem;
    }
}

/* 工具提示 */
.tooltip {
    font-size: 0.75rem;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表格行悬停效果 */
.table-hover tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* 选中状态 */
.table tbody tr.table-active {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

/* 自定义滚动条 */
.offcanvas-body::-webkit-scrollbar {
    width: 6px;
}

.offcanvas-body::-webkit-scrollbar-track {
    background: var(--bs-light);
}

.offcanvas-body::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 3px;
}

/* 任务表格整体优化 */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    margin-bottom: 2px;
}

.table tbody tr td {
    border: none;
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* 任务行加载动画 */
@keyframes taskRowFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table tbody tr {
    animation: taskRowFadeIn 0.4s ease-out;
}

/* 层级连接线动画 */
.task-level-2::before,
.task-level-2::after,
.task-level-3::before,
.task-level-3::after {
    transition: all 0.3s ease;
}

.task-row-level-2:hover .task-level-2::before,
.task-row-level-3:hover .task-level-3::before {
    background: linear-gradient(90deg, var(--bs-primary), var(--bs-info));
    box-shadow: 0 0 4px rgba(var(--bs-primary-rgb), 0.3);
}

.task-row-level-2:hover .task-level-2::after,
.task-row-level-3:hover .task-level-3::after {
    background: linear-gradient(180deg, var(--bs-primary), var(--bs-info));
    box-shadow: 0 0 4px rgba(var(--bs-primary-rgb), 0.3);
}

/* 层级指示器动画 */
.task-title-level-1::before,
.task-title-level-2::before,
.task-title-level-3::before {
    transition: all 0.2s ease;
    display: inline-block;
}

.task-row-level-1:hover .task-title-level-1::before {
    transform: scale(1.2);
    text-shadow: 0 0 8px rgba(var(--bs-primary-rgb), 0.6);
}

.task-row-level-2:hover .task-title-level-2::before {
    transform: scale(1.2);
    text-shadow: 0 0 8px rgba(var(--bs-info-rgb), 0.6);
}

.task-row-level-3:hover .task-title-level-3::before {
    transform: scale(1.2);
    text-shadow: 0 0 8px rgba(var(--bs-secondary-rgb), 0.6);
}

/* 任务标题悬停效果 */
.task-title-level-1,
.task-title-level-2,
.task-title-level-3 {
    transition: all 0.2s ease;
}

.task-row-level-1:hover .task-title-level-1 {
    color: var(--bs-primary);
    transform: translateX(3px);
}

.task-row-level-2:hover .task-title-level-2 {
    color: var(--bs-info);
    transform: translateX(2px);
}

.task-row-level-3:hover .task-title-level-3 {
    color: var(--bs-secondary);
    transform: translateX(1px);
}

/* 复选框样式优化 */
.form-check-input {
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* 徽章样式优化 */
.badge {
    transition: all 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 进度条样式优化 */
.progress {
    background-color: rgba(var(--bs-secondary-rgb), 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
    background: linear-gradient(45deg, var(--bs-success), var(--bs-info));
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 任务层级缩进样式 - 专业版 */
.task-level-1 {
    margin-left: var(--task-level-1-indent);
    position: relative;
}

.task-level-2 {
    margin-left: var(--task-level-2-indent);
    position: relative;
}

.task-level-2::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    width: 1rem;
    height: 1px;
    background: linear-gradient(90deg, #dee2e6, #6c757d);
    transform: translateY(-50%);
}

.task-level-2::after {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0;
    width: 1px;
    height: 50%;
    background: linear-gradient(180deg, #dee2e6, #6c757d);
}

.task-level-3 {
    margin-left: var(--task-level-3-indent);
    position: relative;
}

.task-level-3::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    width: 1rem;
    height: 1px;
    background: linear-gradient(90deg, #e9ecef, #adb5bd);
    transform: translateY(-50%);
}

.task-level-3::after {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0;
    width: 1px;
    height: 50%;
    background: linear-gradient(180deg, #e9ecef, #adb5bd);
}

/* 任务层级图标样式 - 专业版 */
.task-level-icon {
    color: #6c757d;
    opacity: 0.8;
    margin-right: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.task-level-icon:hover {
    opacity: 1;
    color: var(--bs-primary);
    transform: translateX(2px);
}

/* 子任务行的背景色和边框 - 专业版 */
.task-row-level-1 {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-left: 3px solid var(--bs-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.task-row-level-2 {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 3px solid var(--bs-info);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 1px 2px rgba(0,0,0,0.03);
}

.task-row-level-3 {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-left: 3px solid var(--bs-secondary);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.02);
}

/* 任务行悬停效果 */
.task-row-level-1:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left-color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.task-row-level-2:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-left-color: var(--bs-info);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 6px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.task-row-level-3:hover {
    background: linear-gradient(135deg, #dee2e6 0%, #ced4da 100%);
    border-left-color: var(--bs-secondary);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 2px 4px rgba(0,0,0,0.06);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* 任务标题的层级样式 - 专业版 */
.task-title-level-1 {
    font-weight: 700;
    color: var(--bs-dark);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    font-size: 1rem;
    letter-spacing: 0.025em;
}

.task-title-level-2 {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.task-title-level-3 {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.9rem;
    letter-spacing: 0.015em;
}

/* 层级指示器 */
.task-title-level-1::before {
    content: '●';
    color: var(--bs-primary);
    margin-right: 0.5rem;
    font-size: 0.75rem;
    vertical-align: middle;
}





.offcanvas-body::-webkit-scrollbar-thumb:hover {
    background: var(--bs-dark);
}